import React, { Component } from 'react';
import axios from 'axios';

// https://api.github.com/search/repositories?q=react&sort=stars
class App extends Component {
    state = {
        items:[]
    }
    render() {
        return (
            <div>
                {
                    this.state.items.map(item => (
                        <p key={item.id}><a href={item.html_url}>{item.full_name}</a></p>
                        ))
                }
            </div>
            )
    }
    componentDidMount() {
        axios.get('https://api.github.com/search/repositories', {
            params: {
                q: 'react',
                sort:'stars'
            }
        }).then(value=>{this.setState({items:value.data.items})})
    }

}

export default  App;